<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<title>实名认证状态</title>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app.css">
		<style>
			body{background: #fff;overflow: auto;}
			.mui-bar {width: 7.5rem;position: relative !important;}
			.img_box{width: 1.04rem;height: 1.20rem;margin: 0 auto;margin-top: 0.2rem;margin-bottom: 0.24rem;}
			.img_box img{width:100%;}
			.info{padding-left: 0.85rem;padding-right: 0.86rem;font-size: 0.28rem;color: #666666;line-height: 0.4rem;}
			.transit{width: 100%;height: 0.75rem;background: #f3f3f3;margin-top: 0.42rem;line-height: 0.75rem;font-size: 0.30rem;color: #333333;padding-left: 0.27rem;margin-bottom: 0.28rem;}
			.approve{width: 100%;padding-left: 0.27rem !important;margin: 0 !important;}
			.approve li{width: 6.99rem;height: 1.80rem;background: #f0f0f0;margin-bottom: 0.1rem;border-radius: 0.1rem;position: relative;padding-top: 0.52rem;padding-left: 0.39rem;}
			.approve .tel{background: url(../../images/work/tel_bg.png) no-repeat;background-size: contain;}
			.approve .bank{background: url(../../images/work/bank_bg.png) no-repeat;background-size: contain;}
			.approve .ckrz{background: url(../../images/work/ckrz_bg.png) no-repeat;background-size: contain;}
			.approve li .icon_img{width: 0.8rem;height: 0.8rem;}
			.approve li .text1{color:#fff;position: absolute;top: 0.52rem;left: 1.45rem;font-size: 0.32rem;}
			.approve li .text2{color:#fff;position: absolute;top: 1.03rem;left: 1.45rem;font-size: 0.28rem;}
			.approve .sbk .text1,.approve .jsz .text1,.approve .gjj .text1{color:#666666;}
			.approve .sbk .text2,.approve .jsz .text2,.approve .gjj .text2{color:#9f9f9f;}
			.approve li .success{background: url(../../images/work/rz_success.png) no-repeat center center;background-size: contain;width: 0.83rem;height: 1.04rem;position: absolute;top: -0.08rem;right: 0.34rem;}
			.approve li .fail{color: #515151;font-size: 0.3rem;position: absolute;right:0.6rem ;top:0.74rem ;}
		</style>
	</head>
	<body>
		<!--<div class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<a class="back">返回</a>
			<h1 class="mui-title">认证通道</h1>
		</div>-->
		<div class="img_box">
			<img src="../../images/work/smrz.png" alt="" />
		</div>
		<div class="info">根据国家政策规定，注册用户必须完成至少2种 的实名认证才能进行网上申请等业务的办理。</div>
		<div class="transit">实名认证通道</div>
		<ul class="approve">
			<li class="ckrz" style="display: none;">
				<img class="icon_img" src="../../images/work/ckrz.png" alt="" />
				<div class="text1">窗口认证</div>
				<div class="text2">已窗口实名认证通过</div>
				<div class="success"></div>
			</li>
			<li class="tel">
				<img class="icon_img" src="../../images/work/tel.png" alt="" />
				<div class="text1">手机号认证</div>
				<div class="text2">手机号、身份证号、真实姓名校验</div>
				<div class="fail" style="display: none;">未开通</div>
				<div class="success" style="display: none;"></div>
			</li>
			<li class="bank">
				<img class="icon_img" src="../../images/work/card.png" alt="" />
				<div class="text1">银联卡</div>
				<div class="text2">银联卡、身份证号、真实姓名校验</div>
				<div class="fail" style="display: none;">未开通</div>
				<div class="success" style="display: none;"></div>
			</li>
			<li class="sbk">
				<img class="icon_img" src="../../images/work/sbk.png" alt="" />
				<div class="text1">社保卡</div>
				<div class="text2">社保卡、真实姓名等校验</div>
				<div class="fail">未开通</div>
				<div class="success" style="display: none;"></div>
			</li>
			<li class="jsz">
				<img class="icon_img" src="../../images/work/jsz.png" alt="" />
				<div class="text1">驾驶证</div>
				<div class="text2">驾驶证、真实姓名等校验</div>
				<div class="fail">未开通</div>
				<div class="success" style="display: none;"></div>
			</li>
			<li class="gjj">
				<img class="icon_img" src="../../images/work/gjj.png" alt="" />
				<div class="text1">公积金</div>
				<div class="text2">公积金、真实姓名等校验</div>
				<div class="fail">未开通</div>
				<div class="success" style="display: none;"></div>
			</li>
		</ul>
	
	
	
	</body>
	<script>
		function my_immersed(immersed){
			
		}
	</script>
	<script src="../../js/immersed.js"></script>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/common.js"></script>
	<script src="../../js/app.js"></script>
	<script>
		var isPhone = false;
		var bankCard = false;
		mui.plusReady(function(){
			initData();
		})
		function initData() {
			var user = getUser();
			var idVerifyStatus = user.idVerifyStatus;
			if (idVerifyStatus) {
				if (idVerifyStatus.indexOf('1') >= 0) {//手机号实名
					isPhone = true;
					document.querySelector('.tel .success').style.display = 'block';
				}
				if (idVerifyStatus.indexOf('2') >= 0) {//银联卡
					bankCard = true;
					document.querySelector('.bank .success').style.display = 'block';
				}
			}
			
			if(user != null && user != undefined){
				if(utils.getUrlParam("smrzFlag") == 'true'){
		            document.querySelector('.ckrz').style.display = 'block';
				}else if (user.windowHandleStatus != undefined && user.windowHandleStatus != null && ('-1' == user.windowHandleStatus || '0' == user.windowHandleStatus)) {
	                document.querySelector('.ckrz').style.display = 'block';
	            }
			}
		}
		
		//手机号认证
		document.querySelector('.tel').addEventListener('tap',function(){
			if (idVerifyState(function(isVerify){
				if (isVerify) {//身份证已认证
					if (isPhone) {
						mui.toast('您已通过手机号实名认证，无需再次认证');
						return;
					} else {
						showTemplates('tel_rz.html','手机号实名认证','_www/src/login/tel_rz.html');
					}
				} else {//先进行实名认证
					showTemplates('shiming.html','身份证实名认证','_www/src/login/shiming.html?verifyType=tel');
				}
			})) {
				
			} else {
				mui.toast('当前登录人信息不正确');
				return;
			}
		})
		//银联卡认证
		document.querySelector('.bank').addEventListener('tap',function(){
			if (idVerifyState(function(isVerify){
				if (isVerify) {//身份证已认证
					if (bankCard) {
						mui.toast('您已通过银联卡实名认证，无需再次认证');
						return;
					} else {
						showTemplates('yhk_rz.html','银联卡实名认证','_www/src/login/yhk_rz.html');
					}
				} else {//先进行实名认证
					showTemplates('shiming.html','身份证实名认证','_www/src/login/shiming.html?verifyType=yhk');
				}
			})) {
				
			} else {
				mui.toast('当前登录人信息不正确');
				return;
			}
		})
		
		window.addEventListener('updateData',function(){
			initData();
		})
		
		/**
		 * 身份证实名状态
		 */
		function idVerifyState(callbak) {
			var user = getUser();
			if (!user) {
				return false;
			}
			var verify = user.idVerifyStatus;
			if (verify === undefined) {
				return false;
			}
			if(verify.indexOf('3') >= 0) {
				callbak(true);
			} else {
				callbak(false);
			}
			return true;
		}
	</script>
</html>